pkg_name=alsa-lib
version=1.0.29
build_dir=$builds_dir_root/$pkg_name-$version
src_dir=$src_dir_root/$pkg_name-$version
url=ftp://ftp.alsa-project.org/pub/lib/$pkg_name-$version.tar.bz2

cd "$src_dir_root"
rm -Rf "$pkg_name-$version"
tar jxf "$pkg_name-$version.tar.bz2"

rm -Rf "$build_dir"
mkdir -p "$build_dir"
cd "$build_dir"

export CFLAGS=-O0
"$src_dir/configure"		\
	--prefix=/		\
	--disable-static	\
	--disable-debug		\
	--disable-old-symbols	\
	--disable-python	\
	--with-gnu-ld		\
	--without-versioned	\
	--without-debug 	\
	--without-softfloat	\
	--with-libdl		\
	--with-pthread		\
	--with-librt		\
	--with-pcm-plugins=all	\
	--with-ctl-plugins=all
	
unset CFLAGS

make

install_tmp_dir=/tmp/$pkg_name-$version
rm -Rf "$install_tmp_dir"
mkdir -p "$install_tmp_dir"
make install "DESTDIR=$install_tmp_dir"

install_dirs "$builders_dir_root/$pkg_name/runtime.dirs"
install_files "$builders_dir_root/$pkg_name/runtime.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/runtime.links"
install_dirs "$builders_dir_root/$pkg_name/devel.dirs"
install_files "$builders_dir_root/$pkg_name/devel.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/devel.links"
elf_strip "$builders_dir_root/$pkg_name/elf-strip"

#it wants an "audio" entry in /etc/group with a GID of 116
if ! egrep '^audio:' /etc/group; then
    echo "audio::116:" >>/etc/group
fi

rm -Rf "$install_tmp_dir"
rm -Rf "$build_dir"
rm -Rf "$src_dir"
